﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebUI.Models;

namespace WebUI.Controllers
{
    public class UsersController : Controller
    {
        //
        // GET: /Users/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult Login()
        {
            return View();
        }
        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Login(UserLoginModel model)
        {
            if (ModelState.IsValid && !model.UserName.Equals("Username") && !model.Password.Equals("Password"))
            {
                return RedirectToAction("Index","Home");
            }
            ModelState.AddModelError("", "Username and Password provider is incorrect");
            return View(model);
        }
    }
}
